import * as actionTypes from './constants';

const defaultstate = {
    banners: [],
    num:9,
    index:0, //tabbar 哪个被激活?
    personalized:[],
    singerMessage:[],
    changeSingerMessage:[],
    songSheetDetail:[]
    
}

const reducer = (state = defaultstate, action) => {
    
    switch (action.type) {
        case actionTypes.SET_INDEX:
            return {...state,index:action.data}
        case actionTypes.SET_NUM:
            return{...state,num:action.data}
        case actionTypes.CHANGE_BANNERS:
            // console.log(action.data,"#####");
            return {...state, banners: action.data }
        case actionTypes.CHANGE_PERSONALIZED:
            // console.log(action.data,"#####");
            return {...state, personalized: action.data }
        case actionTypes.GET_HOTSINGERLISTREQUEST:
            return {...state,singerMessage:action.data}
        case actionTypes.GET_CHANGESINGERLIST:
            return {...state,changeSingerMessage:action.data}
        case actionTypes.GET_SONGSHEETDETAIL:
            return {...state,songSheetDetail:action.data}
        default:
            return state;
    }
    
}
export default reducer;